package tcts0421;
// https://leetcode-cn.com/problems/sqrtx/
public class x的平方根0426 {
    public int mySqrt(int x) {
        int left=0,right=x,ans=0;
        while(left<=right){
            int mid = left+(right-left)/2;
            if((long)mid*mid<=x){
                ans = mid;
                left = mid + 1;
            }else{
                right = mid -1;
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        Integer a= new Integer(100);
        Integer a1= new Integer(100);
        Integer a3=128;
        Integer a4=128;
        System.out.println(a3==a4);
    }
}
